<template>
  <div>
    <!-- <div>
      <van-search
        v-model="searchvalue"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
        input-align="center"
      />
    </div> -->
    <div  v-if="userType==1||userType==2">
      <van-tabs v-model="active" title-active-color="#333333" title-inactive-color="#808080">
        <van-tab title="私人出租"></van-tab>
        <van-tab title="企业用车"></van-tab>
      </van-tabs>
    </div>

    <div v-if="active == 1">
      <van-tabs v-model="QYactive" title-active-color="#333333" title-inactive-color="#808080">
        <van-tab title="待支付"></van-tab>
        <van-tab title="待确认"></van-tab>
        <van-tab title="已完成"></van-tab>
        <van-tab title="全部"></van-tab>
      </van-tabs>
    </div>

    <div class="listview" v-if="active == 0">
      <privateitem></privateitem>
    </div>

    <div class="listview" v-if="active == 1">
      <company @xiangqing="xiangqing" :active="QYactive"></company>
     </div>
  </div>
</template>

<script>
import company from './Company/index';
import privateitem from './Private/index';
export default {
  data() {
    return {
      userType:0,
      active: 0,
      QYactive:0,
      searchvalue: undefined,
      messageerr: {
        searcherr: false,
        networkerr: false,
        tongyongerror: false
      }
    };
  },
  created() {
    this.userType = localStorage.getItem("userType")
  },
  components:{
    company,
    privateitem
  },
  methods: {
    xiangqing(e){
      console.log(e)
      this.$router.push({
        path: "/PersonalCar/Incomeinquiry/detil",
        query: {
          id: e.billNo,
        }
      });
    },
    onSearch() {},
    onCancel() {}
  }
};
</script>


<style  scoped>
.listview {
  padding: 8px 12px;
  background-color: #f5f5f5;
}

.cardview {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  box-shadow: 0px 1px 2px #ccc;
  border: 1px solid #dddddd;
  border-radius: 3px;
  margin-bottom: 8px;
}

.cardview-flex1 {
  flex: 2;
  text-align: center;
}

.cardview-flex1 img {
  width: 7rem;
  height: 7rem;
}

.cardview-flex2 {
  flex: 2;
  line-height: 1.5rem;
}

.cardview-flex3 {
  flex: 2;
}
</style>
